package org.csmzclass2333;
import java.util.Scanner;
public class example01 {
        public static void main(String[] args) {
            Scanner scanner = new Scanner(System.in);
            System.out.print("请输入一个三位数: ");
            int num = scanner.nextInt();

            if (num >= 100 && num <= 999) {
                int hundreds = num / 100;
                int tens = (num / 10) % 10;
                int units = num % 10;

                int sum = (int) (Math.pow(hundreds, 3) + Math.pow(tens, 3) + Math.pow(units, 3));

                if (sum == num) {
                    System.out.println(num + " 是水仙花数。");
                } else {
                    System.out.println(num + " 不是水仙花数。");
                }
            } else {
                System.out.println("输入的不是三位数，请重新输入。");
            }

            scanner.close();
        }
    }
